x86/MSI: fix error handling
authorJan Beulich <jbeulich@suse.com>
Thu, 26 Mar 2015 10:19:57 +0000 (11:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Mar 2015 10:19:57 +0000 (11:19 +0100)
commit29c1b7886c36d4e6aa03a779b2251b829d9689c3
treee84dab6ab10b9c75264fca88052fc80b30e941fc
parentfcc17f96c2776eb220e3dee79fd0ad6a624ffcd9
x86/MSI: fix error handling

__setup_msi_irq() needs to undo what it did before calling
write_msi_msg() in case that returned an error.

map_domain_pirq() needs to get rid of the MSI descriptor it
(implicitly) allocated. The case of a setup_msi_irq() failure on a
non-initial multi-vector-MSI interrupt needs special handling: While
the initial IRQ will get freed by the caller (who also passed it to
us), we need to undo the effect setup_msi_irq() had on it. (As a
benefit from the added call to msi_free_irq() we no longer need to
explicitly call destroy_irq() on the non-initial slots.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/irq.c
xen/arch/x86/msi.c